Skip to content

docs: translate module docs to Chinese (#1691)#1791

Open
nuthalapativarun wants to merge 3 commits into
MemTensor:dev-20260525-v2.0.18from
nuthalapativarun:docs/translate-module-docs-cn-1691
Open

docs: translate module docs to Chinese (#1691)#1791
nuthalapativarun wants to merge 3 commits into
MemTensor:dev-20260525-v2.0.18from
nuthalapativarun:docs/translate-module-docs-cn-1691

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Description

Translate module documentation from English to Chinese.

Files added:

  • docs/cn/open_source/modules/model_backend.md
  • docs/cn/open_source/modules/api_deployment.md
  • docs/cn/open_source/modules/mos/memos_mcp.md
  • docs/cn/open_source/modules/mos/memos_neo.md

Class names, API names, code blocks, and command examples remain in English. Only explanatory prose is translated.

Related Issue (Required): Fixes #1691

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

MCP clients such as Cherry Studio always pass filter:{} in conversation
mode. FastMCP rejects unknown or invalid parameters, returning HTTP 400
"Invalid request parameters". Accept the filter parameter and normalise
an empty dict to None so the call succeeds.

Fixes MemTensor#1718
@hijzy hijzy changed the base branch from main to dev-20260525-v2.0.18 May 27, 2026 09:47
@hijzy
Copy link
Copy Markdown
Collaborator

hijzy commented May 27, 2026

The CI Ruff checks are failing and need to be fixed before this can be merged:

  • tests/api/test_mcp_serve.py has 2 unused imports. ruff check fixed them automatically, which means the committed file is not clean.
  • ruff format --check reports that tests/api/test_mcp_serve.py needs formatting.

Please run locally:

poetry run ruff check --fix tests/api/test_mcp_serve.py
poetry run ruff format tests/api/test_mcp_serve.py

@nuthalapativarun
Copy link
Copy Markdown
Author

Fixed the Ruff lint/format issues in tests/api/test_mcp_serve.py — CI should pass now.

@Memtensor-AI Memtensor-AI added the memos Core MemOS logic (memory, MCP, scheduler, API, database) label May 29, 2026
Copy link
Copy Markdown
Collaborator

@Memtensor-AI Memtensor-AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me review this PR carefully.

Needs minor changes

The docs translation looks solid and the MCP fix is well-tested. A few issues worth addressing:

Code issues

1. filter parameter accepted but never used (src/memos/api/mcp_serve.py:273-299)

The filter param is added to the signature and normalized to None, but it's never passed to self.mos_core.search():

if not filter:
    filter = None
result = self.mos_core.search(query, user_id, cube_ids)  # filter not forwarded

If this is intentional (just to prevent MCP clients from erroring when they send filter: {}), add a comment making that explicit. If it should actually filter results, wire it through.

2. filter shadows the built-in (src/memos/api/mcp_serve.py:276)

Using filter as a parameter name shadows Python's built-in. Consider search_filter or filters instead. Minor, but it can confuse linters and developers.

3. if not filter is overly broad (src/memos/api/mcp_serve.py:297)

not filter is truthy for {}, None, [], 0, "", etc. If the intent is specifically "empty dict or None → treat as no filter," be explicit:

if filter is None or filter == {}:
    filter = None

This avoids accidentally swallowing a filter value of 0 or False if the type annotation ever loosens.

Documentation nits

4. Typo in memos_neo.md — the embedding dimension is stated as 3027:

维度为 text-embedding-3-large(dim-size 3027)

OpenAI's text-embedding-3-large default dimension is 3072. If this is a project-specific truncation, clarify; otherwise fix the number.

5. memos_mcp.md JSON has a trailing comma (line ~96 of the new file):

"--transport", "stdio"
],
//   "cwd": "/path/to/your/MemOS pip user is optional",

The commented-out cwd line with // isn't valid JSON. This will confuse users who copy-paste. Either remove it or use a note outside the code block.

Test feedback

Tests are clean and cover the key cases well. One suggestion: add a test with a non-empty filter dict (e.g., filter={"tag": "work"}) to document the current behavior (that it's silently ignored). This prevents future regressions if someone later wires filter through.

PR hygiene

The PR description says "Fixes #1691" but #1691 appears to be the PR itself, not a separate issue. Double-check the linked issue number.

Overall the translation quality is good — class names and code stay in English as promised, and the prose reads naturally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

memos Core MemOS logic (memory, MCP, scheduler, API, database)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translate module docs to Chinese

3 participants